package cn.intotw.rdcj.task.spiders.netty;
import java.util.concurrent.FutureTask;
/**
 * Created by Chenxiang
 *
 * @generator: IntelliJ IDEA
 * @description: 可以手动set的futuretask
 * @project: rdcj
 * @package: cn.intotw.rdcj.commodity.spiders.netty
 * @date: 2020年07月23日 14时52分
 */
public class SettableTask<T> extends FutureTask<T> {
    public SettableTask() {
        super(() -> {
            throw new IllegalStateException("Should never be called");
        });
    }

    public void setResultValue(T value) {
        this.set(value);

    }

    public void setExceptionResult(Throwable exception) {
        this.setException(exception);
    }

    @Override
    protected void done() {
        super.done();
    }


}